package io.zhengsh.vvip.leetcode.twopointer;

public class Q189_Rotate_Array {

    public static void main(String[] args) {

    }

    class Solution {
        public void rotate(int[] nums, int k) {
            int l = nums.length;
            int[] newArr = new int[l];

            for (int i = 0; i < l; i++) {
                newArr[(i + k) % l] = nums[i];
            }
            System.arraycopy(newArr, 0, nums, 0, l);
        }
    }
}
